import SimpleFillSymbol from "@arcgis/core/symbols/SimpleFillSymbol"

/**
 * 点、线、面通用创建类
 */
export class SymbolUtils {
    private constructor() { }
    private static _pintsymbol: SymbolUtils = new SymbolUtils();
    private static _fillsymbol: SimpleFillSymbol = new SimpleFillSymbol();
    private static _polylineSymbol: SimpleFillSymbol = new SimpleFillSymbol();
    /**
       * 红色点符号
       */
    static getPointSymbol(): SymbolUtils {
        return this._pintsymbol = {
            type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()        
            color: "red",
            size: "20px",  // pixels
            outline: {  // autocasts as new SimpleLineSymbol()
                color: [128, 128, 128, 0.5],
                width: 5  // points
            }
        };
    }
    /**
     * 面的填充
     * @returns 
     */
    static getFillSymbol(): SimpleFillSymbol {
        return this._fillsymbol = new SimpleFillSymbol({
            color: [51, 51, 204, 0.2],
            style: "solid",
            outline: {  // autocasts as new SimpleLineSymbol()
                color: "red",
                width: 3
            }
        });
    }
    /**
     * 填充了颜色的面符号，红色边框，蓝色低透明度
     * @returns 
     */
    static getLineSymbol(): SimpleFillSymbol {
        return this._polylineSymbol = new SimpleFillSymbol({
            color: [51, 51, 204, 0.2],
            style: "solid",
            outline: {  // autocasts as new SimpleLineSymbol()
                color: "red",
                width: 5
            }
        })
    }


}